<template>
	<view>
		<web-view :src="h5Src" @message="handleMessage"></web-view>
	</view>
</template>

<script>
	import mixin from '@/util/mixin.js';
	// import { request } from '@/http/config.js';
	export default {
		mixins: [mixin],
		data() {
			return {
				h5Src:'',
				id:'',
				mobile:'',
				code:'',
				name:''
			}
		},
		// // 分享到好友
		// onShareAppMessage(res) {
		// 	const params = '?mobile=' + this.mobile +'&code=' + this.code + '&id=' + this.id +  '&name=' + this.name + '&mode=share';
		// 	console.log(params);
		// 	if (res.from === 'button') {
		// 	  // 来自页面内转发按钮
		// 		 return {
		// 		   title: '中小学生社会实践活动',
		// 		   path: '/pagesD/webview' + params,
		// 		   imageUrl:''
		// 		 }
		// 	} else {
		// 	   return {
		// 		 title: '中小学生社会实践活动',
		// 		  path: '/pagesD/webview' + params,
		// 		 imageUrl:''
		// 	   }
		// 	}
		// },
		onLoad(options) {
		    console.log(options);
			// const params = '?id=' + options.id + '&mobile=' + this.mobile +'&code=' + this.code + '&id=' + this.id +  '&name=' + this.name
			// this.id = options.id;
			this.mobile = options.tel;
			this.code = options.code;
	
			// if(options.mode == 'share') {
			// 	//分享进来来需要登录
			// 	//console.log('分享页面')
			// 	this.getToke();
			// }
			  this.h5Src = 'https://activity.etjbooks.com.cn/web/mobile/v2/#/pages/tab-infor/tab-infor?id=19&mobile=' + this.mobile +'&code=' + this.code + '&time=5'
			  console.log(this.h5Src);
		},

		methods:{
			// async getToke() {
			// 	const res2 = await request('site/get_user_info',{},"get");
			// 	const user_id = res2.data.user_id;
			// 	this.mobile = res2.data.user_mobile;
			// 	const res = await request('user/get_activity_login',{app_key:'pmyyuqkippgnpowdvd', app_secret:'maur0JgZtYjZYTOl4TAKIDIhIoH0u3St','user_mobile':this.mobile},"post","lb");
			// 	this.code = res.data;
			// }
		}
	}
</script>
